package ch.ethz.fcl.metrobuzz.data.scene.spacetime;

import java.util.ArrayList;

public class Agent {
	private long agentId;
	private Itinerary itinerary = null;

	public Agent(long id) {
		this.agentId = id;
	}

	public long getAgentId() {
		return agentId;
	}

	public void setItinerary(Itinerary iti) {
		this.itinerary = iti;
	}

	public Itinerary getItinerary() {
		return itinerary;
	}

	@Override
	public String toString() {
		int nodeCount = 0;

		ArrayList<Trip> trips = itinerary.getTrips();
		int tripCount = trips.size();
		for (int j = 0; j < trips.size(); j++) {
			for (int k = 0; k < trips.get(j).getTripSegments().size(); k++) {
				int[] nodes = trips.get(j).getTripSegments().get(k)
						.getNodesIndices();
				nodeCount = nodeCount + nodes.length;
			}
		}

		return ("Agent: " + agentId + " Trips: " + tripCount + " Nodes: " + nodeCount);
	}
}
